import { Component } from '@angular/core';
import { AuthService } from '../auth.service';

@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ['./navbar.component.css']
})
export class NavbarComponent {

  haBeVanLepve:boolean = false;

  constructor(private authService:AuthService){


    //Itt döntöm el, hogy a NAV-ban mi jelenjen meg. belepesInfo: true/false.
    authService.getIsLogged().subscribe(
                                          {
                                            next: (belepesInfo:any):void => { this.haBeVanLepve = belepesInfo; },
                                            error: ():void => {},
                                            complete: ():void => {}
                                          }
    );

    //
  }

  /***********************************/
  /************* Kilépés *************/
  /***********************************/
  kilepes():void{
    this.authService.signOut().then(
                                    ():void => {
                                                console.log("Kiléptél.");
                                              }
                                  );
  }
}
